#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    vector<int> singleNumber(vector<int>& nums) {
        int x = 0;
        for (auto e : nums) {
            x ^= e;
        }
        int l = x == INT_MIN ? x : x & (-x);
        int t1 = 0, t2 = 0;
        for (auto e : nums) {
            if (e & l)
                t1 ^= e;
            else
                t2 ^= e;
        }
        return { t1, t2 };
    }
};